home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / contrib / f2c95201 / diff / f2c_go32.dif
Encoding:
Text File  |  1995-02-06  |  12.2 KB  |  414 lines

  1. =============================================================================
  2.                     f2c_go32.dif (for f2c Version 19950201)
  3.  
  4. Brief Note
  5. ----------
  6. By applying this patch to a complete set of f2c source files available from 
  7. ftp://netlib.att.com/netlib/f2c/, you can build f2c that works with djgpp.
  8. You need ~/* and ~/src/* in this directory.  You also have to uncompress all 
  9. the files, and unarchive the shell-archived library sources, i.e., libf77
  10. and libi77.  Then, follow the instruction described below:
  11.  
  12.     1) Go to the top directory of your f2c source directory tree.
  13.     2) patch -p1 < f2c_go32.dif.
  14.     3) Run mk.bat (it is safe to remove any *old* f2c.h in your djgpp's
  15.        include paths before running mk.bat).
  16.     4) You'll get ./src/f2c.exe and ./libf2c.a.
  17.     5) Install f2c.exe, f2c.h and libf2c.a like this:
  18.            C>install c:\djgpp (should be your djgpp top directory).
  19.        You may manually copy them instead.
  20.  
  21. You need "grep", "sed", "cat" and "rm" running under DOS for successful
  22. compilation.  GNUish stuffs (available from SimTel) work fine.  djgpp version
  23. of "sed" does as well.
  24.  
  25. This patch was organized by R. Araki in cooperation with H. Kuroki, thanks
  26. to suggestions by net people both at FEXT, niftyserve.or.jp and djgpp-ML.  You 
  27. can easily identify the changes by searching a string "K&R (Kuroki & Raraki)".
  28.  
  29. This file is distributed in the hope that it will be useful, but WITHOUT 
  30. ANY WARRANTY.  Any suggestions/ideas will be appreciated.  You must obey the
  31. description written in "permission" available from netlib.att.com:/netlib/f2c/
  32. if you redistribute this file.
  33.  
  34. Important Notice
  35. ----------------
  36. libF77.a and libI77.a are combined into a single library named libf2c.a in 
  37. accordance with description in netlib.att.com:/netlib/f2c/readme.  You 
  38. *must* specify "-lf2c -lm" instead of "-lF77 -lI77 -lm" with ld or gcc.  You
  39. may want to modify f2c.1 and/or f2c.1t, since I kept them unmodified.
  40.  
  41. The following macro defined in f2c.h may conflict with function prototype
  42. declaration of abs() in djgppstd.h (i.e., int abs(int);).
  43.  
  44. > #define abs(x) ((x) >= 0 ? (x) : -(x))
  45.  
  46. I didn't comment it out because David M. Gay (dmg@research.att.com), a
  47. member of the f2c development team at AT&T Bell Labs, recommended me to
  48. leave it unmodified.  Consider applying the following patch to djgppstd.h:
  49.  
  50.   > *** djgppstd.org        Tue Nov 29 02:10:22 1994
  51.   > --- djgppstd.h  Tue Jan 24 13:02:26 1995
  52.   > ***************
  53.   > *** 58,60 ****
  54.   > --- 58,62 ----
  55.   >  void  abort(void);
  56.   > + #ifndef F2C_INCLUDE
  57.   >   int       abs(int);
  58.   > + #endif
  59.   >   int       access(const char*, int);
  60.  
  61.  
  62. Enjoy!!
  63.                                   February 6, 1995  Ryuichiro ARAKI
  64.                                                     raraki@human.waseda.ac.jp
  65.                                                     MCN00365@niftyserve.or.jp
  66. =============================================================================
  67. diff --context=1 --recursive --new-file f2c_orig/install.bat f2c_go32/install.bat
  68. *** f2c_orig/install.bat    Wed Dec 31 19:00:00 1969
  69. --- f2c_go32/install.bat    Mon Feb  6 11:32:32 1995
  70. ***************
  71. *** 0 ****
  72. --- 1,35 ----
  73. + @echo off
  74. + REM a batch file to install f2c.exe, f2c.h and libf2c.a
  75. + REM 12/18/94 by raraki
  76. + if M%1 == M goto usage
  77. + if not exist .\src\f2c.exe goto makeexe
  78. + echo copying f2c.exe to %1\bin
  79. + copy .\src\f2c.exe %1\bin
  80. + if not exist .\f2c.h goto chkf2ch
  81. + echo copying f2c.h to %1\include
  82. + copy .\f2c.h %1\include
  83. + if not exist .\libf2c.a goto makelibf2c
  84. + echo copying libf2c.a to %1\lib
  85. + copy .\libf2c.a %1\lib
  86. + goto end
  87. + :usage
  88. + echo usage:- install [your djgpp's top directory (e.g., c:\djgpp)]
  89. + goto end
  90. + :makeexe
  91. + echo .\src\f2c.exe not found. You have to make it first.
  92. + goto end
  93. + :chkf2ch
  94. + echo .\f2c.h not found. You have to check it.
  95. + goto end
  96. + :makelibf2c
  97. + echo .\libf2c.a not found. You have to make it first.
  98. + goto end
  99. + :end
  100. diff --context=1 --recursive --new-file f2c_orig/libf77/makefile f2c_go32/libf77/makefile
  101. *** f2c_orig/libf77/makefile    Sat Feb  4 20:22:02 1995
  102. --- f2c_go32/libf77/makefile    Mon Feb  6 11:32:36 1995
  103. ***************
  104. *** 1,5 ****
  105.   .SUFFIXES: .c .o
  106. ! CC = cc
  107. ! SHELL = /bin/sh
  108. ! CFLAGS = -O
  109.   
  110. --- 1,10 ----
  111.   .SUFFIXES: .c .o
  112. ! # 12/15/94 by K&R (Kuroki & Raraki)
  113. ! CC = gcc
  114. ! #SHELL = /bin/sh
  115. ! # Some files may need to include ../f2c.h.
  116. ! # You may check whether djgpp's onexit() works or not. If it works
  117. ! # fine, you may omit "-DNO_ONEXIT".
  118. ! # 12/17/94 by K&R (Kuroki & Raraki)
  119. ! CFLAGS = -O2 -m486 -I.. -DNO_ONEXIT
  120.   
  121. ***************
  122. *** 17,20 ****
  123.       $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
  124. !     ld -r -x -o $*.xxx $*.o
  125. !     mv $*.xxx $*.o
  126.   
  127. --- 22,28 ----
  128.       $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
  129. ! # Some people reported that in some cases "ld -r -x" doesn't work well
  130. ! # with djgpp. The drawback is larger object files. Uncomment the following
  131. ! # lines if you are sure it works fine. 12/17/94 by K&R (Kuroki & Raraki)
  132. ! #    ld -r -x -o $*.xxx $*.o
  133. ! #    mv $*.xxx $*.o
  134.   
  135. ***************
  136. *** 41,46 ****
  137.   
  138. ! libF77.a : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
  139.       $(HALF) $(CMP) $(EFL) $(CHAR)
  140. !     ar r libF77.a $?
  141. !     ranlib libF77.a
  142.   
  143. --- 49,57 ----
  144.   
  145. ! libf77/*.o : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
  146.       $(HALF) $(CMP) $(EFL) $(CHAR)
  147. ! # You don't have to build libF77.a, since libf2c.a will include *.o here.
  148. ! # If you really need to have it, uncomment the following lines.
  149. ! # 12/18/94 by K&R (Kuroki & Raraki)
  150. ! #    ar r libF77.a $?
  151. ! #    ranlib libF77.a
  152.   
  153. ***************
  154. *** 57,59 ****
  155.   clean:
  156. !     rm -f libF77.a *.o
  157.   
  158. --- 68,72 ----
  159.   clean:
  160. ! # 12/21/94 by K&R (Kuroki & Raraki)
  161. ! #    rm -f libF77.a *.o
  162. !     rm -f *.o
  163.   
  164. diff --context=1 --recursive --new-file f2c_orig/libf77/s_paus.c f2c_go32/libf77/s_paus.c
  165. *** f2c_orig/libf77/s_paus.c    Sat Feb  4 20:22:02 1995
  166. --- f2c_go32/libf77/s_paus.c    Mon Feb  6 11:32:36 1995
  167. ***************
  168. *** 18,21 ****
  169. --- 18,30 ----
  170.   #endif
  171. + /* to avoid conflict with djgppstd.h.
  172. +  * 12/15/94 by K&R (Kuroki & Raraki)
  173. +  */
  174. + #ifndef __GO32__
  175.   extern int getpid(void), isatty(int), pause(void);
  176. + #else  /* __GO32__ */
  177. + extern int getpid(void), isatty(int);
  178. + extern void volatile pause(void);
  179. + #endif /* __GO32__ */
  180.   #endif
  181. + /* end of Patch */
  182.   
  183. diff --context=1 --recursive --new-file f2c_orig/libi77/fio.h f2c_go32/libi77/fio.h
  184. *** f2c_orig/libi77/fio.h    Sat Feb  4 20:22:02 1995
  185. --- f2c_go32/libi77/fio.h    Mon Feb  6 11:32:38 1995
  186. ***************
  187. *** 1 ****
  188. --- 1,7 ----
  189. + /* to avoid conflict with djgppstd.h.
  190. +  * 12/18/94 by K&R (Kuroki & Raraki)
  191. +  */
  192. + #if defined(abs) && defined(__GO32__)
  193. + #undef abs
  194. + #endif
  195.   #include "stdio.h"
  196. diff --context=1 --recursive --new-file f2c_orig/libi77/makefile f2c_go32/libi77/makefile
  197. *** f2c_orig/libi77/makefile    Sat Feb  4 20:22:02 1995
  198. --- f2c_go32/libi77/makefile    Mon Feb  6 11:32:40 1995
  199. ***************
  200. *** 1,5 ****
  201.   .SUFFIXES: .c .o
  202. ! CC = cc
  203. ! CFLAGS = -O
  204. ! SHELL = /bin/sh
  205.   
  206. --- 1,8 ----
  207.   .SUFFIXES: .c .o
  208. ! # 12/15/94 by K&R (Kuroki & Raraki)
  209. ! CC = gcc
  210. ! # Some files may need to include ../f2c.h.
  211. ! # 12/15/94 by K&R (Kuroki & Raraki)
  212. ! CFLAGS = -O2 -m486 -I..
  213. ! #SHELL = /bin/sh
  214.   
  215. ***************
  216. *** 8,11 ****
  217.       $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
  218. !     ld -r -x -o $*.xxx $*.o
  219. !     mv $*.xxx $*.o
  220.   
  221. --- 11,17 ----
  222.       $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
  223. ! # Some people reported that in some cases "ld -r -x" doesn't work well
  224. ! # with djgpp. The drawback is larger object files. Uncomment the following
  225. ! # lines if you are sure it works fine. 12/17/94 by K&R (Kuroki & Raraki)
  226. ! #    ld -r -x -o $*.xxx $*.o
  227. ! #    mv $*.xxx $*.o
  228.   
  229. ***************
  230. *** 15,19 ****
  231.       util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o
  232. ! libI77.a:    $(OBJ)
  233. !         ar r libI77.a $?
  234. !         ranlib libI77.a
  235.   install:    libI77.a
  236. --- 21,28 ----
  237.       util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o
  238. ! libi77/*.o:    $(OBJ)
  239. ! # You don't have to build libI77.a, since libf2c.a will include *.o here.
  240. ! # If you really need to have it, uncomment the following lines.
  241. ! # 12/18/94 by K&R (Kuroki & Raraki)
  242. ! #        ar r libI77.a $?
  243. ! #        ranlib libI77.a
  244.   install:    libI77.a
  245. ***************
  246. *** 31,34 ****
  247.   clean:
  248. !     rm -f $(OBJ) libI77.a
  249.   clobber:    clean
  250. --- 40,44 ----
  251.   clean:
  252. ! # 12/21/94 by K&R (Kuroki & Raraki)
  253. ! #    rm -f $(OBJ) libI77.a
  254. !     rm -f *.o
  255.   clobber:    clean
  256. diff --context=1 --recursive --new-file f2c_orig/libi77/rawio.h f2c_go32/libi77/rawio.h
  257. *** f2c_orig/libi77/rawio.h    Sat Feb  4 20:22:02 1995
  258. --- f2c_go32/libi77/rawio.h    Mon Feb  6 11:32:42 1995
  259. ***************
  260. *** 3,5 ****
  261.   #else
  262. ! #ifdef MSDOS
  263.   #include "io.h"
  264. --- 3,8 ----
  265.   #else
  266. ! /*
  267. !  * 12/15/94 by K&R (Kuroki & Raraki)
  268. !  */
  269. ! #if defined(MSDOS) && !defined(__GO32__)
  270.   #include "io.h"
  271. diff --context=1 --recursive --new-file f2c_orig/mk.bat f2c_go32/mk.bat
  272. *** f2c_orig/mk.bat    Wed Dec 31 19:00:00 1969
  273. --- f2c_go32/mk.bat    Mon Feb  6 11:32:44 1995
  274. ***************
  275. *** 0 ****
  276. --- 1,41 ----
  277. + @echo off
  278. + REM a batch file to build all.
  279. + REM 12/17/94 by raraki
  280. + cd .\src
  281. + make
  282. + if errorlevel 1 goto src_err
  283. + cd ..\libf77
  284. + make
  285. + if errorlevel 1 goto libf77_err
  286. + cd ..\libi77
  287. + make
  288. + if errorlevel 1 goto libi77_err
  289. + cd ..
  290. + ar rvs libf2c.a libf77/*.o libi77/*.o
  291. + if errorlevel 1 goto libf2c_err
  292. + echo finished.
  293. + goto end
  294. + :src_err
  295. + cd ..
  296. + echo An error occurred while making f2c.exe
  297. + goto end
  298. + :libf77_err
  299. + cd ..
  300. + echo An error occurred while making libf77/*.o
  301. + goto end
  302. + :libi77_err
  303. + cd ..
  304. + echo An error occurred while making libi77/*.o
  305. + goto end
  306. + :libf2c_err
  307. + echo An error occurred while making libf2c.a
  308. + goto end
  309. + :end
  310. diff --context=1 --recursive --new-file f2c_orig/src/makefile f2c_go32/src/makefile
  311. *** f2c_orig/src/makefile    Sat Feb  4 20:22:02 1995
  312. --- f2c_go32/src/makefile    Mon Feb  6 11:32:46 1995
  313. ***************
  314. *** 2,6 ****
  315.   
  316. ! g = -g
  317. ! CFLAGS = $g
  318. ! SHELL = /bin/sh
  319.   
  320. --- 2,11 ----
  321.   
  322. ! # 12/15/94 by K&R (Kuroki & Raraki)
  323. ! CC=gcc
  324. ! CFLAGS = -O2 -m486 
  325. ! #SHELL = /bin/sh
  326. ! # 12/15/94 by K&R (Kuroki & Raraki)
  327. ! YACC = bison
  328. ! YFLAGS = -v
  329.   
  330. ***************
  331. *** 10,25 ****
  332.         parse_args.o niceprintf.o cds.o sysdep.o version.o
  333. ! OBJECTS = $(OBJECTSd) malloc.o
  334.   
  335. ! all: xsum.out f2c
  336. ! f2c: $(OBJECTS)
  337.       $(CC) $(LDFLAGS) $(OBJECTS) -o f2c
  338.   
  339.   gram.c:    gram.head gram.dcl gram.expr gram.exec gram.io defs.h tokdefs.h
  340. !     ( sed <tokdefs.h "s/#define/%token/" ;\
  341. !         cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in
  342. !     $(YACC) $(YFLAGS) gram.in
  343.       echo "(expect 4 shift/reduce)"
  344. !     sed 's/^# line.*/\/* & *\//' y.tab.c >gram.c
  345. !     rm -f gram.in y.tab.c
  346.   
  347. --- 15,45 ----
  348.         parse_args.o niceprintf.o cds.o sysdep.o version.o
  349. ! # 12/15/94 by K&R (Kuroki & Raraki)
  350. ! OBJECTS = $(OBJECTSd) #malloc.o
  351.   
  352. ! # 12/15/94 by K&R (Kuroki & Raraki)
  353. ! #all: xsum.out f2c
  354. ! all: f2c.exe
  355. ! # 12/15/94 by K&R (Kuroki & Raraki)
  356. ! #f2c: $(OBJECTS)
  357. ! #    $(CC) $(LDFLAGS) $(OBJECTS) -o f2c
  358. ! f2c.exe: $(OBJECTS)
  359.       $(CC) $(LDFLAGS) $(OBJECTS) -o f2c
  360. +     strip f2c
  361. +     coff2exe f2c
  362.   
  363. + # 12/15/94 by K&R (Kuroki & Raraki)
  364.   gram.c:    gram.head gram.dcl gram.expr gram.exec gram.io defs.h tokdefs.h
  365. ! #    ( sed <tokdefs.h "s/#define/%token/" ;\
  366. ! #        cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in
  367. ! #    $(YACC) $(YFLAGS) gram.in
  368. !     sed <tokdefs.h "s/#define/%%token/" > gram
  369. !     cat gram.head gram.dcl gram.expr gram.exec gram.io >>gram
  370. !     $(YACC) $(YFLAGS) gram
  371.       echo "(expect 4 shift/reduce)"
  372. ! # 12/15/94 by K&R (Kuroki & Raraki)
  373. ! #    sed 's/^# line.*/\/* & *\//' y.tab.c >gram.c
  374. ! #    rm -f gram.in y.tab.c
  375. !     sed 's/^# line.*/\/* & *\//' gram_tab.c >gram.c
  376. !     rm -f gram gram_tab.c
  377.   
  378. ***************
  379. *** 87,90 ****
  380.   #carriage-return characters.
  381.   xsumr.out: xsum $b
  382. !     ./xsum -r $b >xsum1.out
  383. !     cmp xsum0.out xsum1.out && mv xsum1.out xsumr.out
  384. --- 107,115 ----
  385.   #carriage-return characters.
  386. + # 12/17/94 by K&R (Kuroki & Raraki), thanks to K. Masaki's suggestion.
  387.   xsumr.out: xsum $b
  388. !     echo.exe -o xsum.rf $b
  389. !     go32 xsum -r @xsum.rf >xsum1.out
  390. !     echo cmp xsum0.out xsum1.out >ifdiff.bat
  391. !     echo if errorlevel 1 copy xsum1.out xsumr.out >>ifdiff.bat
  392. !     ifdiff.bat
  393. !     rm ifdiff.bat xsum.rf
  394.